home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / BTCLASS.ZIP / BTCLASS@.EXE / TUTOR.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-27  |  3.7 KB  |  150 lines

  1. /*//////////////////////////////////////////////////////////////////////////
  2. ///            ___                                                       ///
  3. ///          /_____\                                                     ///
  4. ///         |       |                 Copyright (c) 1991                 ///
  5. ///         |   R   |                                                    ///
  6. ///     ----|_______|----                     by                         ///
  7. ///   /------/ | | \------\                                              ///
  8. ///  |       | | | |       |      --  Object Resource Group  --          ///
  9. ///  |   O   | | | |   G   |                                             ///
  10. ///  |       |/   \|       |          4323 Brown Suite 249               ///
  11. ///   -------       -------            Dallas,  TX  75219                ///
  12. ///   Object Resource Group                                              ///
  13. ///                                      (214) 528-2745                  ///
  14. ///                                                                      ///
  15. ///                                    All Rights Reserved.              ///
  16. ///                                                                      ///
  17. //////////////////////////////////////////////////////////////////////////*/
  18.  
  19. #if !defined(TUTOR_HPP)
  20. #define TUTOR_HPP
  21.  
  22.  
  23. enum Boolean {False, True};
  24.  
  25. struct Address
  26.    {
  27.    char street[26];
  28.    char city[21];
  29.    char state[3];
  30.    char zip[12];    // only 11 needed but keep even boundary
  31.    };
  32.  
  33.  
  34. struct Person
  35.    {
  36.    // key 0
  37.    unsigned long id;    //unique for each person - maps to other objects
  38.  
  39.    // key 1
  40.    char name[26];    // lastname, first
  41.  
  42.    Address shipAddress;
  43.    };
  44.  
  45.  
  46.  
  47. class PersonDataSet : public BT_DataSet
  48.    {
  49. public:
  50.    BT_Key *key;    // yuch - never make variables public unless doing simple
  51.         // tutorials
  52.  
  53.    PersonDataSet() : BT_DataSet("person.tbt") {}
  54.    ~PersonDataSet() {}
  55.  
  56.    int Menu();
  57.    int Add();
  58.    int Modify();
  59.    int List();
  60.    };
  61.  
  62.  
  63. struct Item
  64.    {
  65.    // key 0
  66.    unsigned itemNumber;        // unique for each item
  67.    char description[36];
  68.    double unitCost;
  69.    };
  70.  
  71.  
  72. class ItemDataSet : public BT_DataSet
  73.    {
  74. public:
  75.    BT_Key *key;    // yuch - never make variables public unless doing simple
  76.         // tutorials
  77.  
  78.    ItemDataSet() : BT_DataSet("item.tbt") {}
  79.    ~ItemDataSet() {}
  80.  
  81.    int Menu();
  82.    int Add();
  83.    int Modify();
  84.    int List();
  85.    };
  86.  
  87.  
  88. struct OrderItem
  89.    {
  90.    // key 0
  91.    char orderNumber[10];        // maps to purchase order
  92.  
  93.    unsigned itemNumber;        // maps to item
  94.    double quantity;        // amount ordered
  95.    double purchaseCost;        // cost at time of order
  96.    };
  97.  
  98.  
  99. class OrderItemDataSet : public BT_DataSet
  100.    {
  101. public:
  102.    BT_Key *key;    // yuch - never make variables public unless doing simple
  103.         // tutorials
  104.    ItemDataSet itemDS;
  105.  
  106.    OrderItemDataSet() : BT_DataSet("o_item.tbt") {}
  107.    ~OrderItemDataSet() {}
  108.  
  109.    int Add(const char *orderNumber);
  110.    };
  111.  
  112.  
  113.  
  114. struct Order
  115.    {
  116.    // key 0
  117.    char number[10];        // unique for each Order
  118.  
  119.    unsigned long personID;    //person who called in order
  120.  
  121.    // key 1 - manual key with paidFlag
  122.    char dateOrdered[8];        // YYMMDD - there are better but this is
  123.                 // easier (sorry)
  124.    Boolean paidFlag;        // True if paid
  125.    };
  126.  
  127.  
  128. class OrderDataSet : public BT_DataSet
  129.    {
  130.    PersonDataSet personDS;
  131.    OrderItemDataSet orderItemDS;
  132. public:
  133.    BT_Key *key;    // yuch - never make variables public unless doing simple
  134.         // tutorials
  135.  
  136.    OrderDataSet() : BT_DataSet("order.tbt") {}
  137.    ~OrderDataSet() {}
  138.  
  139.    int Menu();
  140.    int Add();
  141.    int Modify();
  142.    int List();
  143.    int PrintOne();
  144.    };
  145.  
  146.  
  147.  
  148.  
  149. #endif
  150.